<?php


namespace api\web\validate;


use think\Validate;

class BannerValidate extends Validate
{
    //定义验证规则
    protected $rule = [
        'image' => 'require',
        'url' => 'require',
        'id' => 'require'
    ];

    //定义验证失败时的提示信息
    protected $message = [

        'image.require' => '图片不能为空',
        'url.require' => '链接不能为空',

        'id.require' => 'id不能为空',
        //......
    ];

    //验证场景
    protected $scene = [
        'add' => ['image','url'],
        'edit' => ['image','id'],
    ];

}